﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="XMLSchema1"
           targetNamespace="http://KyKoSoft.com/wsdp.xsd"
           elementFormDefault="qualified"
           xmlns="http://KyKoSoft.com/wsdp.xsd"
           xmlns:mstns="http://tempuri.org/XMLSchema1.xsd"
           xmlns:xs="http://www.w3.org/2001/XMLSchema">

    <xs:annotation>
        <xs:documentation>
            Schema for the wsdEditor project file.
        </xs:documentation>
    </xs:annotation>

    <xs:element name="wsdProject">
        <xs:annotation>
            <xs:documentation>
                Root node of the project file.
            </xs:documentation>
        </xs:annotation>

        <xs:complexType>
            <xs:sequence>
                <xs:element name="name"
                            minOccurs="1"
                            maxOccurs="1"
                            type="xs:string">
                    <xs:annotation>
                        <xs:documentation>
                            Name of the project (displayed in the project tree).
                        </xs:documentation>
                    </xs:annotation>
                </xs:element>
                <xs:element name="description"
                            minOccurs="1"
                            maxOccurs="1"
                            type="xs:string">
                    <xs:annotation>
                        <xs:documentation>
                            Description of the contents of the project.
                        </xs:documentation>
                    </xs:annotation>
                </xs:element>

                <xs:element name="sequences"
                            minOccurs="1">
                    <xs:annotation>
                        <xs:documentation>
                            List of sequences in the projects.
                        </xs:documentation>
                    </xs:annotation>

                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="sequence"
                                        minOccurs="1">
                                <xs:annotation>
                                    <xs:documentation>
                                        An individual sequence in the project.
                                    </xs:documentation>
                                </xs:annotation>

                                <xs:complexType>
                                    <xs:sequence>
                                        <xs:element name="name"
                                                    minOccurs="1"
                                                    type="xs:string">
                                            <xs:annotation>
                                                <xs:documentation>
                                                    The name of the sequence.
                                                </xs:documentation>
                                            </xs:annotation>
                                        </xs:element>
                                        <xs:element name="description"
                                                    minOccurs="1"
                                                    type="xs:string">
                                            <xs:annotation>
                                                <xs:documentation>
                                                    A brief description of the sequence.
                                                </xs:documentation>
                                            </xs:annotation>
                                        </xs:element>
                                        <xs:element name="data"
                                                    minOccurs="1"
                                                    type="xs:string">
                                            <xs:annotation>
                                                <xs:documentation>
                                                    The actual sequence text (uri encoded) for the diagram.
                                                </xs:documentation>
                                            </xs:annotation>
                                        </xs:element>

                                        <xs:element name="options"
                                                    minOccurs="1">
                                            <xs:annotation>
                                                <xs:documentation>
                                                    The options specified for the sequence such as style, scale, etc.
                                                </xs:documentation>
                                            </xs:annotation>

                                            <xs:complexType>
                                                <xs:sequence>
                                                    <xs:element name="style"
                                                                minOccurs="1"
                                                                type="xs:string">
                                                        <xs:annotation>
                                                            <xs:documentation>
                                                                The style to use when creating the diagram.
                                                            </xs:documentation>
                                                        </xs:annotation>
                                                    </xs:element>
                                                    <xs:element name="scale"
                                                                minOccurs="1"
                                                                type="xs:positiveInteger">
                                                        <xs:annotation>
                                                            <xs:documentation>
                                                                The scale to use when rendering the diagram (10, 20, ..., 100)
                                                            </xs:documentation>
                                                        </xs:annotation>
                                                    </xs:element>
                                                </xs:sequence>
                                            </xs:complexType>
                                        </xs:element>
                                    </xs:sequence>
                                </xs:complexType>
                            </xs:element>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>

            <xs:attribute name="version"
                          type="xs:decimal"
                          use="required">
                <xs:annotation>
                    <xs:documentation>
                        The version of wsdEditor that created this file.
                    </xs:documentation>
                </xs:annotation>
            </xs:attribute>
        </xs:complexType>
    </xs:element>
</xs:schema>
